package com.jk.controller;


import com.jk.api.YuDingApi;
import com.jk.po.OrderPO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.mongodb.core.MongoTemplate;
import org.springframework.data.mongodb.core.query.Criteria;
import org.springframework.data.mongodb.core.query.Query;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Controller;

import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.concurrent.TimeUnit;

/***
 * @ClassName: YuDingController
 * @Description:TODO
 * @Auther: 景晨璇
 * @Date: 2021/7/7 14:33
 * @version : V1.0
 */
@Controller
public class YuDingController implements YuDingApi {
    @Autowired
    private MongoTemplate mongoTemplate;
    @Autowired
    private RedisTemplate redisTemplate;

    @Override
    public void addYuDing(OrderPO orderPO) {
        String key = "1111";
        redisTemplate.opsForHash().put(key,orderPO.getOrdernumber(),orderPO);

        redisTemplate.expire(key,1, TimeUnit.DAYS);
    }
}
